package com.weblog.weblogapi.controller;

import com.weblog.weblogapi.dao.pojo.ArticleTag;
import com.weblog.weblogapi.service.TagService;
import com.weblog.weblogapi.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("tag")
public class TagController {
    @Autowired
    private TagService tagService;
    //查询所有标签
    @GetMapping
    private Result getAllTag(){return tagService.getAllTag();}
    //删除文章标签
    @PostMapping("delete")
    private Result deleteTag(@RequestParam int id){return tagService.deleteTag(id);}
    //添加文章标签
    @PostMapping("insert")
    private Result insertTag(@RequestBody ArticleTag articleTag){return tagService.insertTag(articleTag);}
}
